/* @(#)GSLoginAction.java    
*
* Project: BUS
*
* Modify Information:
* =============================================================================
*   Author       Date       Description
*   ------------ ---------- ---------------------------------------------------
*   Simonyi Peng 2006-2-7    建立
*
* Copyright Notice:
* =============================================================================
*    Copyright (c) 2001-2006 Beijing HiTRUST Technology Co., Ltd. 1808 Room, 
*        Science & Technology Building, No. 9 South Street, Zhong Guan Cun, 
*        Haidian District, Beijing ,100081, China All rights reserved.
*
*    This software is the confidential and proprietary information of
*        Beijing HiTRUST Technology Co., Ltd. ("Confidential Information").
*        You shall not disclose such Confidential Information and shall use it
*        only in accordance with the terms of the license agreement you entered
*        into with HiTRUST.
*
* Warning:
* =============================================================================
* 
*/
package com.hitrust.gs.action;

import java.util.ArrayList;
import java.util.HashMap;

import com.hitrust.gs.bean.GSOperatorBean;
import com.hitrust.gs.dao.GSOrderDeptInfoDAO;
import com.hitrust.gs.form.GSPayReceiveQueryForm;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.lib.GSLogWriter;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
import com.hitrust.gs.service.GSBaseManager;
import com.hitrust.gs.util.exception.*;
import com.hitrust.gs.util.lang.StringUtils;
import com.hitrust.gs.util.page.ResultProcess;
import com.hitrust.gs.vo.GSPayReceiveQueryVO;
import com.hitrust.gs.business.GSBusOrgProcessor;
import com.hitrust.gs.business.GSPayReceiveProcessor;


public class GSPayReceiveManageQueryAction extends GSBaseAction {
	public String execute(GSBaseForm aForm) throws GSException {
	    
	    GSOperatorBean operatorBean = (GSOperatorBean)aForm.getSession().getAttribute(GSBaseConstants.LOGIN);
        GSPayReceiveProcessor proc = new GSPayReceiveProcessor();
	        
	    String[] buffer = null;

	    GSPayReceiveQueryForm tForm = (GSPayReceiveQueryForm)aForm;
	    GSPayReceiveQueryVO oaqVO = new GSPayReceiveQueryVO();
	    
	    oaqVO.deptcategory = tForm.deptcategory;
	    oaqVO.deptId = tForm.deptid;
	    oaqVO.provName = tForm.provname;
	    
	    if(aForm.getRequest().getAttribute("ISQUERYCONDITIONEXIST")!=null){
	        //是执行完返回的，读出查询条件
	        oaqVO = (GSPayReceiveQueryVO)aForm.getSession().getAttribute("QUERYCONDITION");
	    }
	    else{
		    //初次查询，缓存查询条件
		    aForm.getSession().setAttribute("QUERYCONDITION",oaqVO);
	    }

        try{

		    ArrayList offsetList = proc.getPayReceiveAble(operatorBean,oaqVO);
            tForm.getRequest().setAttribute("offsetlist",offsetList);
            
            ArrayList tList = null;
            
        }catch(GSException e){
            aForm.getRequest().setAttribute("action", "A180501.do");
            throw e;
        }catch(Exception ex){
	        GSLogWriter.error(this,ex.toString());
	        tForm.getRequest().setAttribute("action","A180501.do");
	        throw new GSException(GSException.E20080,GSException.E20080_MSG);
	    }
        
        GSBusOrgProcessor processor = new GSBusOrgProcessor ();
        ArrayList ary = processor.getSubOrg(operatorBean.getGs_oper_org_id());
        aForm.getRequest().setAttribute("organdaddr",ary);

        return GSBaseConstants.FORWARD_SUCCESS;
        
	}
}
